from  time import*

def sort_nums (data) :
    flag = 1
    while flag:
        flag = 0
        for i in range (len(data)  -  1) :
            if data[i] > data[i + 1] :
                data[i] ,  data[i +1]   =  data[i + 1] ,  data [i]
                flag = i

def read_f(file) :
      data = [int (i) for i in open(file) ]
      return data

def time_m(mm) :
    step_1 = read_f(mm)
    time_start = time( )
    sort_nums (step_1)
    time_finish = time( )
    print(f'{mm} {int((time_finish - time_start)*1000)}  milliseconds')
time_m("m1_sorted.txt")
time_m('m2_reverse.txt')
time_m("m3_shuffle.txt")
